package com.StarStudio.Service.Impl;

import com.StarStudio.Domain.Annualoutput;
import com.StarStudio.Mapper.AnnualOutputMapper;
import com.StarStudio.Service.AnnualOutputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnualOutputServiceImpl implements AnnualOutputService {

    @Autowired
    private AnnualOutputMapper annualoutputMapper;

    @Override
    public List<Annualoutput> getByZoneId(Integer zoneId) {
        return annualoutputMapper.getByZoneId(zoneId);
    }

    @Override
    public void add(Annualoutput annualoutput, int zoneId) {
        annualoutputMapper.add(annualoutput);
        annualoutputMapper.addToZone_AnnualOutput(zoneId,annualoutput.getAnnualOutput_Id());
    }

    @Override
    public void update(Annualoutput annualoutput) {
        annualoutputMapper.update(annualoutput);
    }


    @Override
    public void delete(Integer annualOutputId) {
        annualoutputMapper.deleteFromZone_AnnualOutput(annualOutputId);
        annualoutputMapper.delete(annualOutputId);
    }
}
